#Include "Protheus.ch"

User Function TstEntLei()

Local dDtIni   := Date()
Local dDtFin   := Date()
Local cAlias   := "TRB"
Local cPath    := GetSrvProfString("StartPath", "") + "COLETA\COLETA.VEC"
Local cNIndex  := CriaTrab(Nil, .F.)
Local cExpress := "DToS(DATA)+LINHA"
Local cFor     := "DTOS(DATA) >= '" + DToS(dDtIni) + "' .And. DTOS(DATA) <= '" + DToS(dDtFin) + "'"

dbUseArea(.T., "DBFCDXADS", cPath, cAlias, .T., .T.)
IndRegua(cAlias, cNIndex, cExpress, Nil, cFor, "Selecionando Registros ... ", .T.)

TRB->(dbGoTop())

While !TRB->(Eof())
	TRB->(dbSkip())
End

Return Nil